package BlogMybatis.blog.mapper;

import BlogMybatis.blog.pojo.Message;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Brandt
 * @since 2020-06-17
 */
public interface MessageMapper extends BaseMapper<Message> {

    //查询父级评论
    List<Message> findByParentIdNull(@Param("ParentId") Long ParentId);

    //查询一级回复
    List<Message> findByParentIdNotNull(@Param("id") Long id);

    //查询二级及以下的所有子集回复
    List<Message> findByReplayId(@Param("childId") Long childId);

}
